<?php 
	$ci =& get_instance();
	$ci->load->model("user/user_model");
	$header_uid = $ci->user_model->get_uid();
	if($header_uid != 0)
	{
		$header_username = $ci->user_model->get_user_name($header_uid); 
	}
	else 
		$header_username = "";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?=$title?></title>
<!--  <link href="<?php echo base_url();?>css/reset-min.css" rel="stylesheet" type="text/css" /> -->
<link href="<?php echo base_url();?>css/layout.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.js"></script>
<script type="text/javascript">
	base_url = "<?php echo base_url();?>";
	site_url = "<?php echo site_url();?>";
</script>
<script type="text/javascript" src="<?php echo SITE_URL; ?>../js/basic.js"></script>
<script type = "text/javascript">
$(document).ready(function(){
	$( ".menu-link" ).mouseover( function(  ){
	    $( this ).css( "background","#2c2c2c" );
	});
	$( ".menu-link" ).mouseleave( function(  ){
	    $( this ).css({"background":"url('<?php echo SITE_URL."..";?>/image/menu.png') repeat-x left"} );
	
	});
	$( ".menu-search" ).mouseover( function(  ){
	    $( this ).css( "background","#2c2c2c" );
	});
	$( ".menu-search" ).mouseleave( function(  ){
	    $( this ).css({"background":"url('<?php echo SITE_URL."..";?>/image/menu.png') repeat-x left"} );
	});

	controller = get_controller();
	$("#google_search_"+controller).attr("selected","selected");
	
});
function google_search_submit(){
	cat = $("#google_search_select").val();
	if(cat == "tipask")
		$("#google_search_form").attr("action","<? echo SITE_URL."../";?>tipask/?question/search/3.html");
	//$("#google_search_form").attr("action","http://localhost/test/post.php");
	$("#google_search_form").submit();
}
</script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-20136541-3']);
  _gaq.push(['_setDomainName', '.shi-bei.com']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head>
<body>
<div id="header">
    <div id="logo"><img src="<?php echo base_url();?>/image/logo.png"></div>
    <div id="header_user">
    		<div id="user_identifier" uid="<?php echo $header_uid?>" username="<?php echo $header_username?>" hidden="true"></div>
			<span style="color:#ea5975;"><?php echo $header_username;?></span>
			<?php if($header_uid > 0):?>
				<span class="topnav"><a target="_top" href="<?php echo base_url();?>tipask/?user/default.html">个人中心</a></span>
				<span class="topnav"><a target="_top" href="<?php echo base_url();?>tipask/?question/add.html">我要提问</a></span>
	            <span class="topnav"><a target="_top" href="<?php echo base_url();?>tipask/?user/logout.html">退出</a></span>&nbsp;&nbsp;
            <?php else:?>
	            <span class="topnav"><a target="_top" href="<?php echo base_url();?>tipask/?user/register.html">注册</a></span>
	            <span class="topnav"><a target="_top" href="<?php echo base_url();?>tipask/?user/login.html">登录</a></span>
			<?php endif;?>            			
    </div>		
    <div id="header_menu">
      <div class="menu-link">
	<a target="_top" class = "headermenu" href="<?php echo base_url();?>index.php">首页</a>
      </div>

      <div class="menu-link" id="menu-link">
	<a target="_top" class = "headermenu" href="<?php echo base_url();?>index.php/share">分享</a>
      </div>
      <div class="menu-link" id="menu-link">
	<a target="_top" class = "headermenu" href="<?php echo base_url();?>index.php/recall/recall_main">回忆</a>
      </div>
      <div class="menu-link" id="menu-link">
	<a target="_top"  class = "headermenu" href="<?php echo base_url();?>tipask/">问答</a>
      </div>
      <div class="menu-link" id="menu-link">
			<a target="_top" class = "headermenu" href="<?php echo base_url();?>tipask/?index/help.html">帮助</a>
      </div>
      <div class="menu-search" id="menu-link">
			<form id="google_search_form" target="_blank" action="<?php echo site_url("search/index");?>" method="POST">
			<div>
			    <input type="text" name="word" id="google_search_input" size="31" />
			    <input type="button" name="sa" id="google_search_button" value="搜索" onclick="google_search_submit();"/>
			    
			    <select name="category" id="google_search_select">
					<option id="google_search_site" value="site">全站</option>
					<option id="google_search_share" value="share">资料分享</option>
					<option id="google_search_recall" value="recall">试卷回忆</option>
					<option id="google_search_tipask" value="tipask">问答</option>
					
			  	</select>
			    
			</div>
			</form>
      </div>
	            	
    </div>
</div>

<div class="body_container">
